<?php
namespace app\api\controller;

use app\api\controller\Base;
use app\goods\model\ImsEweiShopGoods;
use app\member\model\ImsEweiShopMember;
use think\facade\Config;
use think\facade\Request;

class Ucenter extends Base
{
    public function index()
    {
        $openid = Request::param('openid');
        $token = Request::param('token');
        $tokenService = new TokenService();
        $smid = $tokenService->verifyToken($token);

        $where = [ 'id' => $smid ];
        //读取账号信息
        $account_info = ImsEweiShopMember::mk()->where($where)->find();
        if( empty($account_info) ){
            $this->echojson(1,'账号不存在',$account_info);
        }else{
            //登录成功: 生成ticket
            $this->echojson(0,'用户信息',$account_info);
        }
        
    }


    public function scoreList()
    {

        $token = $this->request->get('token');
        $tokenService = new TokenService();
        $smid = $tokenService->verifyToken($token);

        $where = [ 'id' => $smid ];

        $this->echojson(0,'用户信息',['data'=>[]]);
    }
}